package com.lintf.web.controller.bot;

import com.lintf.bot.domain.BotBillCell;
import com.lintf.bot.domain.dto.BotBillCellUpdateDTO;
import com.lintf.bot.domain.dto.BotBillCellUserUpdateDTO;
import com.lintf.bot.service.IBotBillCellService;
import com.lintf.bot.service.IBotBillCellUserService;
import com.lintf.common.core.controller.BaseController;
import com.lintf.common.core.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @ system:Mac
 * @ author:lin tingfeng
 * @ data:2024/2/19 09:29
 * @ package_name:com.lintf.web.controller.bot
 * @ project_name:mobile-project
 * @ desc:
 */
@RestController
@RequestMapping("/bot/bill/cell")
public class BotBillCellController extends BaseController {

    @Autowired
    private IBotBillCellService botBillCellService;

    @Autowired
    private IBotBillCellUserService botBillCellUserService;

    @GetMapping("/getById")
    public AjaxResult getById(BotBillCell dto){
        return AjaxResult.success(botBillCellService.getById(dto.getId()));
    }

    @PostMapping("/update")
    public AjaxResult update(@RequestBody BotBillCellUpdateDTO dto){
        botBillCellService.update(dto);
        return AjaxResult.success();
    }

    @PostMapping("/user/update")
    public AjaxResult updateUser(@RequestBody BotBillCellUserUpdateDTO dto){
        botBillCellUserService.update(dto);
        return AjaxResult.success();
    }

}
